//
// Created by dukang wang on 2025/1/4.
//

#ifndef HYAUDIO_DATAQUEUE_H
#define HYAUDIO_DATAQUEUE_H

#include "PcmData.h"
#include "queue"
#include "pthread.h"

namespace hy {

    class DataQueue {
    public:
        //pcmData 队列
        std::queue<PcmData *> queuePacket;
        //线程锁
        pthread_mutex_t mutexPacket;
        pthread_cond_t condPacket;
        int work;//标记队列是否工作

    public:
        DataQueue();

        ~DataQueue();

        int putPcmData(PcmData *data);

        PcmData *getPcmData();

        int getPcmDataSize();

        int clearPcmData();

        void release();

        void setWork(int work);

    };

}


#endif //HYAUDIO_DATAQUEUE_H
